package com.cnsuning.jobtool;

import org.apache.commons.io.FileUtils;
import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.util.List;

public class GetAllTables {
    @Test
    public void test() throws IOException {
        String fileName = "E:\\基础\\2.系统开发\\07项目管理\\04共享\\订单执行系统_OMSD\\DB2切MYSQL数据迁移\\RDRS规整\\SQL脚本\\版本最新脚本\\mysql最新脚本\\业务库所有表ddl .sql";
        List<String> lines = FileUtils.readLines(new File(fileName));
        for (String line : lines)
        {
            if (line.startsWith("DROP TABLE IF EXISTS"))
            {
                String str = line.split("DROP TABLE IF EXISTS")[1];
                String tablename = str.substring(2,str.length()-2);
                System.out.println(tablename.toUpperCase());
            }
        }
    }
}
